﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using DukeNUS.FacilitiesPlanning.FPSystem;

namespace DukeNUS.FacilitiesPlanning.FPSystem.Models.Account
{
    public class AccountDetail
    {
        public AccountDetail()
        {
            UserID = 0; UserName = "";
            FullName = ""; Designation = "";
            Department = ""; Email = "";
        }

        [Required]
        public int UserID { get; set; }

        [Required,
        MaxLength(50)]
        public string UserName { get; set; }
            
        [Required,
        MaxLength(150)]
        public string FullName { get; set; }

        [Required,
        MaxLength(100)]
        public string Designation { get; set; }

        [Required,
        MaxLength(100)]
        public string Department { get; set; }

        [Required,
        MaxLength(100),
        RegularExpression("^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]{1}|[\\w-]{2,}))@((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" +
                          "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" +
                          "[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$", ErrorMessage = "Invalid email address.")]
        public string Email { get; set; }

    }
}